<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
</head>
<body><form action="LoginCheckServlet" method="post">
  账号:<input type="text" name="username"><br>
  密码:<input type="password" name="password"><br>
  验证码:<input type="text" name="userCode" maxlength="4">
  <img src="ValidateCodeServlet" height="30" width="100" id="validateCodeImg"><br>
  <input type="submit" value="登录"><br>
</form>
<script type="text/javascript">
    var img = document.getElementById("validateCodeImg");
    img.onclick=function () {
        img.src="ValidateCodeServlet?m="+Math.random();
    }
</script>
</body>
</html>